package com.maltys.sign_aspect;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by Rzc on 2018/9/6.
 */
@Slf4j
public enum ErrorCode {
    SUCCESS(0, "success"),

    APP_SIGNATURE_ERROR(103, "signature error"),

    TIMESTAMP_ILLEGAL(10, "basic param error"),
    REQUEST_METHOD_NOT_SUPPORT(101, "Request method not supported"),
    REQ_FREQUENTLY(102, "req limits"),

    USER_NO_EXIST(501,"user not exist"),

    THIRD_PARTY_SERVER_ERROR(997, "third party error"),
    SYSTEM_ERROR(999, "system error");

    private Integer code;
    private String msg;


    ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code == 0 ? code : 111000 + code;
    }

    public String getMsg() {
        return msg;
    }
}
